﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using My.ELibrary.Model.News;
using My.ELibrary.Business.News;

public partial class News_UC_MainNews : System.Web.UI.UserControl
{
    private string m_NewsId = "1";
    protected string NewsId
    {
        get
        {
            return m_NewsId;
        }
        set
        {
            m_NewsId = value;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            List<ElibNewsModel> elibList = new List<ElibNewsModel>();
            elibList = ElibNewsBLL.GetInstance().GetNewsList(1, 1);
            this.litNewTitle.Text  = elibList[0].Title;
            if (elibList[0].Content.Length > 30)
            {
                this.litAll.Text = elibList[0].Content.Substring(0, 30);
            }
            else
            {
                this.litAll.Text = elibList[0].Content;
            }
            NewsId = elibList[0].Id.ToString();
        }
    }
}
